import React, { Component } from 'react'

function Login() {
    return <div>login</div>
}

function Cart() {
    return <div>cart</div>
}

function Auth(Wrap) {
    return class extends Component {
        render() {
            return (
                <div>
                    {this.props.isLogin ? <Wrap /> : <Login />}
                </div>
            )
        }
    }
}

const AuthCart = Auth(Cart);

export default class componentName extends Component {
    render() {
        return (
            <>
                <AuthCart isLogin={true}></AuthCart>
            </>
        )
    }
}
